import random
stuff = dict(solar = 5,
water = 5,
soil = 5,
growth = 0)

dead = 0
size = 1

rates = dict(solar_ab = 1,
water_ab = 1,
soil_ab = 1,
growth_rate = 1)
while dead < 2:
    print '----STATS----\nSolar:', stuff['solar'], '|| Water:', stuff['water'], '|| Soil:', stuff['soil'], '|| Size:', size
    print  "Leaves:", rates['solar_ab'], '|| Roots:', rates['water_ab'], '|| Weight:', rates['soil_ab'], '\n----STATS----'
    x = raw_input("[W]ater\n[S]oil add\n[G]ive sunlight\nWhat will you do? ").lower()
    if x == 'g':
        stuff['solar'] += rates['solar_ab']
        stuff['growth'] += rates['growth_rate']
    if x == 'w':
        stuff['water'] += rates['water_ab']
        stuff['growth'] += rates['growth_rate']
    if x == 's':
        stuff['soil'] += rates['soil_ab']
        stuff['growth'] += rates['growth_rate']
    stuff[random.choice(stuff.keys())] -= rates['growth_rate']
    rates[random.choice(rates.keys())] += rates['growth_rate']
    
    for k in stuff:
        if stuff[k] <= 0:
            dead += 1
            stuff[k] = 1
    if dead >= 2:
        print '\n\nYOUR PLANT HAS DIED A TERRIBLE DEATH!\n\n'
        break
    dead = 0
    
    if stuff['water'] / stuff['soil'] >= 2:
        rates['water_ab'] -= rates['soil_ab']
        print "ALERT! Too much water and not enough soil!"
    elif stuff['soil'] / stuff['solar'] >= 2:
        rates['soil_ab'] -= rates['solar_ab']
        print "ALERT! Too much soil and not enough sun!"
    elif stuff['solar'] / stuff['water'] >= 2:
        rates['solar_ab'] -= rates['water_ab']
        print 'ALERT! Too much sun and not enough water!'
    else:
        size += 1
    if size % 10 == 0:
        print "\nCONGRATULATIONS! Your plant has sprouted a beautiful flower!\n"
        for r in rates:
            rates[r] += stuff['growth']
        size += 1
